package com.qfedu.common.config;

import com.qfedu.common.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 2024/12/26 下午7:19
 * @author Dang.M.H
 * 注册拦截器配置
 */

@Configuration
public class MyWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                // 拦截的路径
                .addPathPatterns("/**");
                // 排除的路径，使用了注解不需要拦截
                // .excludePathPatterns("/sys/user/login");
    }
}
